#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn = 1009;
int n;
ll x[maxn], y[maxn];
ll ans(ll x[]) {
  return x[n/2] - x[(n-1)/2] + 1;
}
void solve() {
  cin>>n;
  for(int i=0; i<n; ++i)
    cin>>x[i]>>y[i];
  sort(x, x+n);sort(y, y+n);
  cout<<ans(x)*ans(y)<<'\n';
}
int main() {
  int tc;cin>>tc;
  while(tc--)solve();
  return 0;
}
